// by Xeno
//#define __DEBUG__
private ["_poss", "_ogroup", "_bpos", "_leadero"];
#include "x_setup.sqf"

_mpos = markerPos QGVAR(sm_560);
_mpos set [2,0];
GVAR(x_sm_pos) = [_mpos]; // index:60 A lonewolf sniper has been sent to make attempt to kill the Civilian Leader of Orekokastro. Find and eliminate him Intel says hes near the Castle.
GVAR(x_sm_type) = "normal"; // "convoy"

#ifdef __SMMISSIONS_MARKER__
if (true) exitWith {};
#endif

if (X_Client && {!GVAR(IS_HC_CLIENT)}) then {
	GVAR(cur_sm_txt) = (localize "STR_DOM_MISSIONSTRING_5013");
	GVAR(current_mission_resolved_text) = (localize "STR_DOM_MISSIONSTRING_5014");
};

if (call FUNC(checkSHC)) then {
	__PossAndOther
	_newpos = [_poss, 150] call FUNC(GetRanPointCircle);
	__GetEGrp(_ogroup)
	_sm_vehicle = _ogroup createUnit [GVAR(sniper), _newpos, [], 0, "FORM"];
	_sm_vehicle setPos _newpos;
	_sm_vehicle call FUNC(removeNVGoggles);
	_sm_vehicle call FUNC(removefak);
	_sm_vehicle setVariable ["BIS_noCoreConversations", true];
	if (GVAR(domdatabase)) then {
		_sm_vehicle addEventHandler ["killed", {if (isPlayer (_this select 1)) then {[QGVAR(PAIKP), _this select 1] call FUNC(NetCallEventCTS)}}];
	};
	_sm_vehicle addEventHandler ["killed", {_this call FUNC(KilledSMTargetNormal)}];
	sleep 2.123;
	_leadero = leader _ogroup;
	_leadero setRank "COLONEL";
	_ogroup allowFleeing 0;
	_ogroup setbehaviour "AWARE";
	_leadero disableAI "DOWN";
};
